from rest_framework import serializers
from .models import WeldVideo,WeldTask,WeldDefects

class WeldTaskerializer(serializers.ModelSerializer):
    inspector_name=serializers.CharField(source="inspector.username",read_only=True)
    inspector_title=serializers.CharField(source="inspector.title",read_only=True)
    reviewer_name=serializers.CharField(source="reviewer.username",read_only=True)
    reviewer_title=serializers.CharField(source="reviewer.title",read_only=True)
    
    class Meta:
        model = WeldTask
        fields = "__all__"
        
class WeldVideoSerializer(serializers.ModelSerializer):
    class Meta:
        model = WeldVideo
        fields = "__all__"
        
class WeldDefectsSerializer(serializers.ModelSerializer):
    class Meta:
        model = WeldDefects
        fields = "__all__"
